package net.kts.attraction.subway.smallpass.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import net.kts.attraction.subway.smallpass.model.infomation.StationInfo;
import net.kts.attraction.subway.smallpass.model.infomation.TransferInfo;

public class LastPath {
	// 출발??
	private StationInfo startStation = null;
	// ?�착??
	private StationInfo endStation = null;
	
	// ?�착???�승??�� ?�을경우)
	private List<TransferInfo> endList = null;
	
	// ?�요?�간
	private double lastTime = 0;
	
	//?�났경로?��? ?�인
	private boolean theEndFlag = false;
	
	//?�레??첫출발이??
	private boolean firstStartFlag = true;
	
	// 거쳐????�� ??
//	private int passStationCount = 0;
	
	// ?�승??
//	private int transferCount = 0;
	// 거쳐???�선
	private List<PassLine> passLineList = null;
	// 거쳐????
	private List<PassStation> passStationList = null;
	
	// 빠른 �?��???�한 거쳐???�선 �?
	private Set<Integer> stationSet = null;
	
	
	public StationInfo getStartStation() {
		return startStation;
	}
	public void setStartStation(StationInfo startStation) {
		this.startStation = startStation;
	}
	public StationInfo getEndStation() {
		return endStation;
	}
	public void setEndStation(StationInfo endStation) {
		this.endStation = endStation;
	}
	public double getLastTime() {
		return lastTime;
	}
	public void setLastTime(double lastTime) {
		this.lastTime = lastTime;
	}

	public List<PassLine> getPassLineList() {
		return passLineList;
	}
	public void setPassLineList(List<PassLine> passLineList) {
		this.passLineList = passLineList;
	}
	public List<PassStation> getPassStationList() {
		return passStationList;
	}
	public void setPassStationList(List<PassStation> passStationList) {
		this.passStationList = passStationList;
	}
	
	
	
	
	public List<TransferInfo> getEndList() {
		return endList;
	}
	public void setEndList(List<TransferInfo> endList) {
		this.endList = endList;
	}
	public Set<Integer> getStationSet() {
		return stationSet;
	}
	public void setStationSet(Set<Integer> stationSet) {
		this.stationSet = stationSet;
	}
	
	
	
	public boolean isTheEndFlag() {
		return theEndFlag;
	}
	public void setTheEndFlag(boolean theEndFlag) {
		this.theEndFlag = theEndFlag;
	}
	
	
	
	public boolean isFirstStartFlag() {
		return firstStartFlag;
	}
	public void setFirstStartFlag(boolean firstStartFlag) {
		this.firstStartFlag = firstStartFlag;
	}
	@Override
	public Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		LastPath lastPath = new LastPath();
		
		lastPath.startStation = this.startStation;
		lastPath.endStation = this.endStation;
		lastPath.endList = this.endList;
		lastPath.lastTime = this.lastTime;
		lastPath.firstStartFlag = this.firstStartFlag;
//		lastPath.passStationCount = this.passStationCount;
		
		lastPath.passLineList = new ArrayList<PassLine>();
		lastPath.passStationList = new ArrayList<PassStation>();
		lastPath.stationSet = new HashSet<Integer>();
		
//		PassLine passLine = null;
		PassLine tempPassLine = null;
//		PassStation passStation = null;
		PassStation teampPassStation = null;
		
		if(this.passLineList != null) {
			for(int indexI = 0 ; indexI < this.passLineList.size() ; ++indexI) {
				tempPassLine = this.passLineList.get(indexI);
				//passLine = (PassLine) tempPassLine.clone();
				
				lastPath.passLineList.add(tempPassLine);
			}
		}
		
		if(this.passStationList != null) {
			for(int indexI = 0 ; indexI < this.passStationList.size() ; ++indexI) {
				teampPassStation = this.passStationList.get(indexI);
				//passStation = (PassStation) teampPassStation.clone();
				
				lastPath.passStationList.add(teampPassStation);
			}
		}			 
		
		if(this.stationSet != null) {
			Iterator<Integer> iterator = this.stationSet.iterator();
			
			while(iterator.hasNext()) {
				lastPath.stationSet.add(iterator.next());
			}
			
		}
		
		return lastPath;
	}
	
	
	
}
